import http from "@/utils/http";
import { AxiosRequestConfig } from "axios";

export interface DeleteDelMetricsModelById_ {
  /**
   * @description id
   */
  id: number;
}
export interface GetGetDeriveModelDetailById_ {
  /**
   * @description id
   */
  id: number;
}
export interface GetGetDerivedDevelopDetailById_ {
  /**
   * @description id
   */
  id: number;
}
export interface GetGetMetricsFilterById_ {
  /**
   * @description id
   */
  id: number;
}
export interface GetGetMetricsModelListById_ {
  /**
   * @description id
   */
  id: number;
}
export interface GetGetMetricsOfDimensionList_ {
  /**
   * @description 指标id
   * @format int32
   */
  metricsId?: number;
  /**
   * @description 模型id
   * @format int32
   */
  modelId?: number;
}
export interface GetGetModelLogicDetailById_ {
  /**
   * @description id
   */
  id: number;
}

export class MetricsModelRelation {
  /**
   * 删除指标加工逻辑任务
   *
   * @tags 指标模型加工-管理
   * @request DELETE: /metricsModel/delMetricsModel/{id}
   * @secure
   */
  deleteDelMetricsModelById = ({ id }: { id: number } | DeleteDelMetricsModelById_, params: AxiosRequestConfig = {}) =>
    http.request<defs.ResponseEntityObject>({
      url: `/metricsModel/delMetricsModel/${id}`,
      method: "DELETE",
      ...params,
    });

  /**
   * 派生指标加工数据预览-分页
   *
   * @tags 指标模型加工-管理
   * @request POST: /metricsModel/getDeriveModelData
   * @secure
   */
  postGetDeriveModelData = (dto: defs.DeriveModelDto, params: AxiosRequestConfig = {}) =>
    http.request<defs.ResponseEntityMetricsModelDataVo>({
      url: `/metricsModel/getDeriveModelData`,
      method: "POST",
      data: dto,
      ...params,
    });

  /**
   * 获取派生指标加工逻辑详情
   *
   * @tags 指标模型加工-管理
   * @request GET: /metricsModel/getDeriveModelDetail/{id}
   * @secure
   */
  getGetDeriveModelDetailById = (
    { id }: { id: number } | GetGetDeriveModelDetailById_,
    params: AxiosRequestConfig = {},
  ) =>
    http.request<defs.ResponseEntityDeriveModelDto>({
      url: `/metricsModel/getDeriveModelDetail/${id}`,
      method: "GET",
      ...params,
    });

  /**
   * 衍生指标加工数据预览-分页
   *
   * @tags 指标模型加工-管理
   * @request POST: /metricsModel/getDerivedDevelopData
   * @secure
   */
  postGetDerivedDevelopData = (dto: defs.DerivedDevelopDto, params: AxiosRequestConfig = {}) =>
    http.request<defs.ResponseEntityMetricsModelDataVo>({
      url: `/metricsModel/getDerivedDevelopData`,
      method: "POST",
      data: dto,
      ...params,
    });

  /**
   * 获取衍生指标开发详情
   *
   * @tags 指标模型加工-管理
   * @request GET: /metricsModel/getDerivedDevelopDetail/{id}
   * @secure
   */
  getGetDerivedDevelopDetailById = (
    { id }: { id: number } | GetGetDerivedDevelopDetailById_,
    params: AxiosRequestConfig = {},
  ) =>
    http.request<defs.ResponseEntityDerivedDevelopDto>({
      url: `/metricsModel/getDerivedDevelopDetail/${id}`,
      method: "GET",
      ...params,
    });

  /**
   * 衍生指标下可用维度列表查询
   *
   * @tags 指标模型加工-管理
   * @request POST: /metricsModel/getDerivedDimList
   * @secure
   */
  postGetDerivedDimList = (dto: defs.DerivedDimensionQuryDto, params: AxiosRequestConfig = {}) =>
    http.request<defs.ResponseEntityListQueryFieldDto>({
      url: `/metricsModel/getDerivedDimList`,
      method: "POST",
      data: dto,
      ...params,
    });

  /**
   * 指标过滤条件列表
   *
   * @tags 指标模型加工-管理
   * @request GET: /metricsModel/getMetricsFilter/{id}
   * @secure
   */
  getGetMetricsFilterById = ({ id }: { id: number } | GetGetMetricsFilterById_, params: AxiosRequestConfig = {}) =>
    http.request<defs.ResponseEntityMetricsFilterDto>({
      url: `/metricsModel/getMetricsFilter/${id}`,
      method: "GET",
      ...params,
    });

  /**
   * 原子指标加工数据预览-分页
   *
   * @tags 指标模型加工-管理
   * @request POST: /metricsModel/getMetricsModelData
   * @secure
   */
  postGetMetricsModelData = (dto: defs.MetricsModelDevelopDto, params: AxiosRequestConfig = {}) =>
    http.request<defs.ResponseEntityMetricsModelDataVo>({
      url: `/metricsModel/getMetricsModelData`,
      method: "POST",
      data: dto,
      ...params,
    });

  /**
   * 获取指标下开发的加工逻辑列表
   *
   * @tags 指标模型加工-管理
   * @request GET: /metricsModel/getMetricsModelList/{id}
   * @secure
   */
  getGetMetricsModelListById = (
    { id }: { id: number } | GetGetMetricsModelListById_,
    params: AxiosRequestConfig = {},
  ) =>
    http.request<defs.ResponseEntityListMetricsModelRelationVo>({
      url: `/metricsModel/getMetricsModelList/${id}`,
      method: "GET",
      ...params,
    });

  /**
   * 指标加工逻辑段日志-分页
   *
   * @tags 指标模型加工-管理
   * @request POST: /metricsModel/getMetricsModelLog
   * @secure
   */
  postGetMetricsModelLog = (dto: defs.MetricsModelLogQueryDto, params: AxiosRequestConfig = {}) =>
    http.request<defs.ResponseEntityPageInfoMetricsModelLogVo>({
      url: `/metricsModel/getMetricsModelLog`,
      method: "POST",
      data: dto,
      ...params,
    });

  /**
   * 获取已开发指标模型下的维度列表-业务限定
   *
   * @tags 指标模型加工-管理
   * @request GET: /metricsModel/getMetricsOfDimensionList
   * @secure
   */
  getGetMetricsOfDimensionList = (
    query: { metricsId?: number; modelId?: number } | GetGetMetricsOfDimensionList_,
    params: AxiosRequestConfig = {},
  ) =>
    http.request<defs.ResponseEntityMetricsFilterDto>({
      url: `/metricsModel/getMetricsOfDimensionList`,
      method: "GET",
      params: query,
      ...params,
    });

  /**
   * 获取指标加工逻辑详情
   *
   * @tags 指标模型加工-管理
   * @request GET: /metricsModel/getModelLogicDetail/{id}
   * @secure
   */
  getGetModelLogicDetailById = (
    { id }: { id: number } | GetGetModelLogicDetailById_,
    params: AxiosRequestConfig = {},
  ) =>
    http.request<defs.ResponseEntityMetricsModelDevelopDto>({
      url: `/metricsModel/getModelLogicDetail/${id}`,
      method: "GET",
      ...params,
    });

  /**
   * 上/下线指标加工逻辑
   *
   * @tags 指标模型加工-管理
   * @request POST: /metricsModel/offLine
   * @secure
   */
  postOffLine = (dto: defs.MetricsModelRelationDto, params: AxiosRequestConfig = {}) =>
    http.request<defs.ResponseEntityObject>({
      url: `/metricsModel/offLine`,
      method: "POST",
      data: dto,
      ...params,
    });

  /**
   * 指标开发列表查询-分页
   *
   * @tags 指标模型加工-管理
   * @request POST: /metricsModel/pageQuery
   * @secure
   */
  postPageQuery = (dto: defs.MetricsDevelopQueryDto, params: AxiosRequestConfig = {}) =>
    http.request<defs.ResponseEntityPageInfoMetricsDevelopVo>({
      url: `/metricsModel/pageQuery`,
      method: "POST",
      data: dto,
      ...params,
    });

  /**
   * 保存派生指标加工
   *
   * @tags 指标模型加工-管理
   * @request POST: /metricsModel/saveDeriveModel
   * @secure
   */
  postSaveDeriveModel = (dto: defs.DeriveModelDto, params: AxiosRequestConfig = {}) =>
    http.request<defs.ResponseEntityObject>({
      url: `/metricsModel/saveDeriveModel`,
      method: "POST",
      data: dto,
      ...params,
    });

  /**
   * 保存衍生指标开发
   *
   * @tags 指标模型加工-管理
   * @request POST: /metricsModel/saveDerivedDevelop
   * @secure
   */
  postSaveDerivedDevelop = (dto: defs.DerivedDevelopDto, params: AxiosRequestConfig = {}) =>
    http.request<defs.ResponseEntityObject>({
      url: `/metricsModel/saveDerivedDevelop`,
      method: "POST",
      data: dto,
      ...params,
    });

  /**
   * 保存原子指标加工逻辑
   *
   * @tags 指标模型加工-管理
   * @request POST: /metricsModel/saveMetricsModel
   * @secure
   */
  postSaveMetricsModel = (dto: defs.MetricsModelDevelopDto, params: AxiosRequestConfig = {}) =>
    http.request<defs.ResponseEntityObject>({
      url: `/metricsModel/saveMetricsModel`,
      method: "POST",
      data: dto,
      ...params,
    });

  /**
   * 修改派生指标加工
   *
   * @tags 指标模型加工-管理
   * @request POST: /metricsModel/updateDeriveModel
   * @secure
   */
  postUpdateDeriveModel = (dto: defs.DeriveModelDto, params: AxiosRequestConfig = {}) =>
    http.request<defs.ResponseEntityObject>({
      url: `/metricsModel/updateDeriveModel`,
      method: "POST",
      data: dto,
      ...params,
    });

  /**
   * 修改衍生指标开发
   *
   * @tags 指标模型加工-管理
   * @request POST: /metricsModel/updateDerivedDevelop
   * @secure
   */
  postUpdateDerivedDevelop = (dto: defs.DerivedDevelopDto, params: AxiosRequestConfig = {}) =>
    http.request<defs.ResponseEntityObject>({
      url: `/metricsModel/updateDerivedDevelop`,
      method: "POST",
      data: dto,
      ...params,
    });

  /**
   * 修改原子指标加工逻辑
   *
   * @tags 指标模型加工-管理
   * @request POST: /metricsModel/updateMetricsModel
   * @secure
   */
  postUpdateMetricsModel = (dto: defs.MetricsModelDevelopDto, params: AxiosRequestConfig = {}) =>
    http.request<defs.ResponseEntityObject>({
      url: `/metricsModel/updateMetricsModel`,
      method: "POST",
      data: dto,
      ...params,
    });
}

export default new MetricsModelRelation();
